package UI;

import java.util.Random;

public class RandomCaptcha {
    public static String Code() {
        Random ran = new Random();
        int i = 0;
        char[] letter = new char[5];
        while (i < 4) {
            int rand1 = ran.nextInt(57) + 65;
            if (rand1 < 91 || rand1 > 96) {
                letter[i] = (char) rand1;
                i++;
            }
        }
        letter[4] = (char)(ran.nextInt(10) + 48);
        String code = new String(letter);
        return code;
    }
}
